package map;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class ConfigDAO {
	private static final String URL="jdbc:odbc:correodsn",USU="correousr",PSW="correopsw";
	private static String ODBC_DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver";
	
	public java.sql.Connection getConnection(){
	
		try {
			return java.sql.DriverManager.getConnection(URL,USU,PSW);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
	
	public PreparedStatement getPreparedStatement(String sql){
		Connection con = getConnection();
		try {
			return con.prepareStatement(sql);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
		
	}
	
	public CallableStatement getPreparedCall(String spName){
		Connection con = getConnection();
		CallableStatement cstmt = null;
		
		try {
			cstmt = con.prepareCall(spName);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return cstmt;
		
		
	}
	


}
